package org.hamster.multidropbox.dropbox.command
{
	import org.hamster.dropbox.DropboxClient;
	import org.hamster.dropbox.DropboxConfig;
	import org.hamster.multidropbox.dropbox.event.AppDropboxEvent;
	import org.hamster.multidropbox.dropbox.model.DropboxClientListProxy;
	import org.hamster.multidropbox.dropbox.model.DropboxClientProxy;
	import org.hamster.multidropbox.dropbox.model.DropboxConfigProxy;
	import org.hamster.multidropbox.dropbox.model.DropboxLinkFoldersProxy;
	import org.hamster.multidropbox.dropbox.model.DropboxStorageProxy;
	import org.puremvc.as3.interfaces.INotification;
	import org.puremvc.as3.patterns.command.SimpleCommand;
	
	public class DropboxInitCommand extends SimpleCommand
	{
		public function DropboxInitCommand()
		{
			super();
		}
		
		override public function execute(notification:INotification):void
		{
			facade.registerCommand(AppDropboxEvent.DROPBOX_STORAGE_LOAD_REQUEST, DropboxStorageLoadCommand);
			facade.registerCommand(AppDropboxEvent.DROPBOX_STORAGE_SAVE_REQUEST, DropboxStorageSaveCommand);
			facade.registerCommand(AppDropboxEvent.DROPBOX_LINK_FOLDERS_REQUEST, DropboxLinkFoldersCommand);
			facade.registerCommand(AppDropboxEvent.DROPBOX_LINK_FOLDERS_UPLOAD_REQUEST, DropboxLinkFoldersUploadCommand);
			facade.registerCommand(AppDropboxEvent.DROPBOX_METADATA_LIST_REQUEST, DropboxGetMetadataListCommand);
			
			facade.registerProxy(new DropboxClientProxy());
			facade.registerProxy(new DropboxConfigProxy());
			facade.registerProxy(new DropboxClientListProxy());
			facade.registerProxy(new DropboxStorageProxy());
			facade.registerProxy(new DropboxLinkFoldersProxy());
			
			this.sendNotification(AppDropboxEvent.DROPBOX_STORAGE_LOAD_REQUEST);
		}
	}
}